package com.lyf.work1;

public class yzm {
    public static void main(String[] args) {
        System.out.println(getYzm(4));
        System.out.println(getYzm(6));
    }
    public static String getYzm(int n){
        String code="";
        for(int i=0;i<n;i++){
            int a=(int)(Math.random()*3);
            int b=(int)(Math.random()*26);
            switch(a){
                case 0:
                    code=code+((int)(Math.random()*10));
                    break;
                case 1:
                    code=code+((char)('A'+b));
                    break;
                case 2:
                    code=code+((char)('a'+b));
                    break;
            }
        }
        return code;

    }
}
